from django.contrib.auth.models import AbstractUser
from django.db import models

# 创建用户模型:基于AbstractUser进行扩展
# 使用时注意: 修改`settings.py`

class User(AbstractUser):
    mobile = models.CharField(max_length=15, unique=True, verbose_name="手机号码")
    avatar = models.ImageField(upload_to='avaters', verbose_name="用户头像")

    class Meta:
        db_table = 'ly_user'
        verbose_name = '用户信息'
        verbose_name_plural = verbose_name